#include "machinemgr.h"


ClientMgr::ClientMgr()
{




}

void ClientMgr::add(TcpClient *c)
{
    for(auto i : m_listClient)
    {
        if(i->peerName()== c->peerName() && i->isValid())
        {
            return;
        }
    }

    m_listClient.push_back(c);
}


TcpClient *ClientMgr::getClient(string ip)
{
    for(auto i : m_listClient)
    {
        if(i->peerName().toStdString()== ip)
        {
            return i;
        }
    }

    return NULL;
}
